using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects {
	public static class BO_portal_articles_comments {
		public static DataTable SelectAll(int status) {
			try {
				usp_portal_articles_comments_select_all entity = new usp_portal_articles_comments_select_all();
				entity.STATUS = status;
				return BO_Actions<usp_portal_articles_comments_select_all>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable SelectTop(int rows, int status) {
			try {
				usp_portal_articles_comments_select_top entity = new usp_portal_articles_comments_select_top();
				entity.NUMBERRECORD = rows;
				entity.STATUS = status;
				return BO_Actions<usp_portal_articles_comments_select_top>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable Search(int comment_id) {
			try {
				usp_portal_articles_comments_search entity = new usp_portal_articles_comments_search();
				entity.COMMENT_ID = comment_id;

				return BO_Actions<usp_portal_articles_comments_search>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable SelectWithPaged(int startIndex, int pageCount, int status) {
			try {
				usp_portal_articles_comments_select_paged entity = new usp_portal_articles_comments_select_paged ();
				entity.STARTINDEX = startIndex;
				entity.MAXRECORDS = pageCount;
				entity.STATUS = status;
				return BO_Actions<usp_portal_articles_comments_select_paged>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static string Insert( Int64 article_id, string title, string email, string full_name, string mobile, string address, string detail, bool is_approved, string approved_by, int order_display, DateTime created_date, DateTime modify_date, string modify_by, bool status) {
			try {
				usp_portal_articles_comments_insert entity = new usp_portal_articles_comments_insert();
                entity.ARTICLE_ID = article_id;
                entity.TITLE = title;
                entity.EMAIL = email;
                entity.FULL_NAME = full_name;
                entity.MOBILE = mobile;
                entity.ADDRESS = address;
                entity.DETAIL = detail;
                entity.IS_APPROVED = is_approved;
                entity.APPROVED_BY = approved_by;
                entity.ORDER_DISPLAY = order_display;
                entity.CREATED_DATE = created_date;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

				return BO_Actions<usp_portal_articles_comments_insert>.ExecuteAndReturnStringValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static string Update( Int64 comment_id, Int64 article_id, string title, string email, string full_name, string mobile, string address, string detail, bool is_approved, string approved_by, int order_display, DateTime created_date, DateTime modify_date, string modify_by, bool status) {
			try {
				usp_portal_articles_comments_update entity = new usp_portal_articles_comments_update();
                entity.COMMENT_ID = comment_id;
                entity.ARTICLE_ID = article_id;
                entity.TITLE = title;
                entity.EMAIL = email;
                entity.FULL_NAME = full_name;
                entity.MOBILE = mobile;
                entity.ADDRESS = address;
                entity.DETAIL = detail;
                entity.IS_APPROVED = is_approved;
                entity.APPROVED_BY = approved_by;
                entity.ORDER_DISPLAY = order_display;
                entity.CREATED_DATE = created_date;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

				return BO_Actions<usp_portal_articles_comments_update>.ExecuteAndReturnStringValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static bool Delete(string ids, string spliter, int delete_type) {
			try {
				usp_portal_articles_comments_delete entity = new usp_portal_articles_comments_delete();
				entity.IDS = ids;
				entity.SPLITER = spliter;
				entity.DELETE_TYPE = delete_type;

				return BO_Actions<usp_portal_articles_comments_delete>.ExecuteAndReturnBooleanValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static bool Restore(int comment_id) {
			try {
				usp_portal_articles_comments_restore entity = new usp_portal_articles_comments_restore();
				entity.COMMENT_ID = comment_id;

				return BO_Actions<usp_portal_articles_comments_restore>.ExecuteAndReturnBooleanValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
	}
}

